<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Home extends Controller
{
	var $site_title;
	var $floatim='';
	
	function Home()
	{
		parent::Controller();
		$this->load->database();
		$this->load->model('com_model');
		$this->site_title=$this->config->item('sys_site_title');
		if($this->config->item('sys_is_open_im') == '1')
		{
			$this->floatim = $this->com_model->floatim();
		}
		if ($this->config->item('sys_cache_time') > 0) $this->output->cache($this->config->item('sys_cache_time'));
	}
	
	function index()
	{
		$data = array(
				'site_title'		=> $this->site_title,
				'aboutus'		    => $this->com_model->get_article('aboutus'),
				'new_product'		=> $this->com_model->get_top_product(12,0,'new'),
				'hot_product'		=> $this->com_model->get_top_product(10,0,'hot'),
				'recommend_product' => $this->com_model->get_top_product(12,0,'recommend'),
				'product_catalog'	=> $this->com_model->parse_pcatalog(0),
				'top_news'		    => $this->com_model->get_top_news(6,0),
				'top_news1'         => $this->com_model->get_top_news(6,3),
				'top_link'		    => $this->com_model->get_link(0)		
		);
		$this->load->view(TPL_FOLDER.'home',$data);
	}
}
?>